package com.zhuozhou.jdyc.main.base.util;

import androidx.databinding.BindingAdapter;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.zhuozhou.jdyc.R;
import com.zhuozhou.jdyc.wight.customlayout.RoundImageView;

/**
 * Create by CherishTang on 2020/3/27 0027
 * describe:
 */
public class ImageViewAttrAdapter {
    @BindingAdapter({"imageUrl"})
    public static void loadImage(RoundImageView imageView, String url) {
        Glide.with(imageView.getContext())
                .load(url)
                .apply(new RequestOptions().error(R.mipmap.icon_head_default).placeholder(R.mipmap.icon_head_default))
                .into(imageView);
    }
}
